package com.ec.edu.common.enums;

public enum MsgType {
    DEVICE(1),
    HEAR(2),

    TEXT(11),
    IMAGE(12),
    VOICE(13),
    VIDEO(14),

    //语音通话
    VOICE_CALL(21),
    //视频通话
    VIDEO_CALL(22),

    //地理位置
    SEND_LOCATION(31),

    //消息签收
    SIGNED(41),

    //拉取好友
    PULL_FRIEND(101);

    ;

    int msgType;

    MsgType(int msgType) {
        this.msgType = msgType;
    }

    public int getMsgType() {
        return msgType;
    }

    public static MsgType getFromMsgType(int msgType) {
        for (MsgType type : MsgType.values()) {
            if (msgType == type.getMsgType()) {
                return type;
            }
        }
        return DEVICE;
    }
}
